﻿using AliyunSmsSDK;
using RXY_Mall.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace RXY_Mall.Api.Models
{
    #region 版本
    /// <summary>
    /// 版本号
    /// </summary>
    public class AppVersionOutput
    {
        /// <summary>
        /// 版本号
        /// </summary>
        public string version { get; set; }
        /// <summary>
        /// 下载地址
        /// </summary>
        public string package_url { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
    }
    #endregion

    #region 版本
    /// <summary>
    /// 设置
    /// </summary>
    public class SettingOutput
    {
        /// <summary>
        /// 提现服务费率 10=>10%
        /// </summary>
        public string withdraw_service_fee_rate { get; set; }
        /// <summary>
        /// 提现最高额度
        /// </summary>
        public string withdraw_max_amount { get; internal set; }
        /// <summary>
        /// 提现最低额度
        /// </summary>
        public string withdraw_min_amount { get; internal set; }
    }
    #endregion

    #region 品牌
    /// <summary>
    /// 获得品牌输出信息
    /// </summary>
    public class GetBrandsOutput
    {
        /// <summary>
        /// 品牌ID
        /// </summary>
        public int brand_id { get; set;}
        /// <summary>
        /// 品牌名称
        /// </summary>
        public string brand_name { get; set; }
        public string brand_logo { get; internal set; }
        public bool is_top { get; internal set; }
    }
    #endregion

    #region SMS

    /// <summary>
    /// 注册输入信息
    /// </summary>
    public class SendSMSByRegisterInput
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空！")]
        public string mobile { get; set; }
    }

    public class SendSMSByUpdateNewMobileInput : BaseInput
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空！")]
        public string mobile { get; set; }
    }


    /// <summary>
    /// 发送验证码输入信息
    /// </summary>
    public class SendSMSInput : BaseInput
    {
        public string mobile { get; set; }
        public SMSType sms_type { get; set; }
    }

    #endregion

    #region 上传文件
    /// <summary>
    /// 上传文件类
    /// </summary>
    public class FileInput : BaseInput
    {
        /// <summary>
        /// 文件类型
        /// </summary>
        public byte type { get; set; }

        ///// <summary>
        ///// base64
        ///// </summary>
        //public string base64Max { get; set; }

        /// <summary>
        /// 文件集合
        /// </summary>
        public List<FileModel> files { get; set; }

        /// <summary>
        /// 文件类
        /// </summary>
        public class FileModel
        {
            /// <summary>
            /// 文件转化成base64
            /// </summary>
            public string base64 { get; set; }
            /// <summary>
            /// 文件名
            /// </summary>
            public string name { get; set; }
            /// <summary>
            /// 文件后缀
            /// </summary>
            public string ext { get; set; }
        }
    }

    /// <summary>
    /// 上传文件类
    /// </summary>
    public class FileSingleInput : BaseInput
    {
        /// <summary>
        /// 文件类型
        /// </summary>
        public byte type { get; set; }
        /// <summary>
        /// 文件转化成base64
        /// </summary>
        public string base64 { get; set; }
        /// <summary>
        /// 文件名
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 文件后缀
        /// </summary>
        public string ext { get; set; }
    }
    #endregion

    #region 地区
    public class AreaOutput
    {
        /// <summary>
        /// 区域父ID
        /// </summary>
        public int? parent_id { get; internal set; }
        /// <summary>
        /// 地区ID
        /// </summary>
        public int area_id;
        /// <summary>
        /// 地区名
        /// </summary>
        public string name;
        /// <summary>
        /// 地区代码
        /// </summary>
        public string code;
        /// <summary>
        /// 深度
        /// </summary>
        public byte? deep { get; internal set; }
        /// <summary>
        /// 下级地区集合
        /// </summary>
        public List<AreaOutput> sub_areas { get; set; }

    }

    public class AddressOutput
    {
        public List<ProvinceItem> province { get; set; }
    }

    /// <summary>
    /// 省
    /// </summary>
    public class ProvinceItem
    {
        public string name { get; set; }
        public string zipcode { get; set; }

        public List<CityItem> city { get; set; }
    }

    /// <summary>
    /// 市
    /// </summary>
    public class CityItem
    {
        public string name { get; set; }
        public string zipcode { get; set; }

        public List<DistrictItem> district { get; set; }
    }

    /// <summary>
    /// 区
    /// </summary>
    public class DistrictItem
    {
        public string name { get; set; }
        public string zipcode { get; set; }
    }

    #endregion

    #region 物流公司
    public class LogisticsOutput
    {
        /// <summary>
        /// 物流公司ID
        /// </summary>
        public int logistics_id { get; set; }
        /// <summary>
        /// 物流公司
        /// </summary>
        public string logistics_name { get; set; }
    }
    #endregion

    public class FreightOutput
    {
        /// <summary>
        /// 是否有货
        /// </summary>
        public bool is_sale { get; set; }
        /// <summary>
        /// 运费模板ID
        /// </summary>
        public int freight_template_id { get; set; }
        /// <summary>
        /// 省编码
        /// </summary>
        public string province_code { get; set; }
        /// <summary>
        /// 市编码
        /// </summary>
        public string city_code { get; set; }
        /// <summary>
        /// 区编码
        /// </summary>
        public string county_code { get; set; }
        /// <summary>
        /// 运费计费类型
        /// </summary>
        public ChargeType charge_type { get; set; }
        /// <summary>
        /// 首件
        /// </summary>
        public int first_number { get; set; }
        /// <summary>
        /// 首费
        /// </summary>
        public decimal first_fee { get; set; }
        /// <summary>
        /// 续件
        /// </summary>
        public int add_number { get; set; }
        /// <summary>
        /// 续费
        /// </summary>
        public decimal add_fee { get; set; }
    }

    
}